package com.shun.upms;

import com.shun.common.utils.ShunEnvUtil;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

@Slf4j
@SpringBootApplication(scanBasePackages="com.shun")
@EnableFeignClients(basePackages = {"com.shun.base"})
@MapperScan("com.shun.upms.mapper")
public class ShunUpmsApp {

    public static void main(String[] args) {
        log.info("权限管理服务启动...");
        SpringApplication shunUpmsApp = new SpringApplication(ShunUpmsApp.class);
        shunUpmsApp.setBannerMode(Banner.Mode.OFF);
        ApplicationContext context = shunUpmsApp.run(args);
        Environment env = context.getEnvironment();
        log.info("权限管理服务启动成功.微服务名称：{},端口:{}", ShunEnvUtil.getApplicationName(env),ShunEnvUtil.getServerPort(env));
    }
}